package com.lau.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lau.common.annotation.OperationLog;
import com.lau.common.enums.OperationTypeEnum;
import com.lau.common.lang.Result;
import com.lau.service.SysLogService;
import com.lau.vo.BaseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Lau
 * @since 2023-11-08
 */
@RestController
@RequestMapping("/sys/log")
public class SysLogController {


	@Autowired
	private SysLogService sysLogService;
	/**
	 * 查询日志列表
	 *
	 * @param queryParams 查询参数
	 * @param page     分页
	 * @return 用户列表
	 */
	@GetMapping("/list")
	@PreAuthorize("hasAuthority('sys:log:list')")
	@OperationLog(event = "查询日志列表", operType = OperationTypeEnum.QUERY)
	public Result list(BaseVo queryParams, Page page) {
		return Result.succ(sysLogService.pageLogs(page, queryParams));
	}
}